package com.foreveross.proxyip.monitor.infra.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.foreveross.proxyip.entity.HistoryIpEntity;
import com.foreveross.proxyip.infra.base.ddd.repository.EntityHibernateRepository;
import com.foreveross.proxyip.monitor.infra.HistorySearchRepository;
@Repository
public class HistorySearchRepositoryImpl extends EntityHibernateRepository implements HistorySearchRepository{

	public List<HistoryIpEntity> findByHQL(String hql, Object[] params,
			int pageIndex, int pageLen) throws Exception {
		// TODO Auto-generated method stub

		try {
			//return super.find(hql, params, RetrieveIpEntity.class);
			return super.queryResult(hql, params,pageIndex,pageLen);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
	}

	public long findSizeByHQL(String hql, Object[] params) throws Exception {
		try {
			return super.queryResultSize(hql, params);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return 0;
		}
	}

}
